//
//  KRPickView.m
//  KEREN
//
//  Created by MW on 2023/3/29.
//

#import "KRPickView.h"

@implementation KRPickView

- (instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if(self){
        self.showsSelectionIndicator = YES;

        //self.backgroundColor = [UIColor clearColor];
    }
    return self;
}

- (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView {
    return _Components;
}
- (NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component {
    return _countArr.count;
}

- (CGFloat)pickerView:(UIPickerView *)pickerView widthForComponent:(NSInteger)component {
    return DEVICE_WIDTH;
}

- (void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component{
    NSString  *_proNameStr = [_countArr objectAtIndex:row];
}

-(NSString*)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component{
    return [_countArr objectAtIndex:row];
}

//- (UIView *)pickerView:(UIPickerView *)pickerView viewForRow:(NSInteger)row forComponent:(NSInteger)component reusingView:(nullable UIView *)view{
//    if(!view){
//        view = [[UIView alloc] init];
//    }
//    UILabel *text = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, DEVICE_WIDTH, 20)];
//    if(component)
//}

@end
